package team.umbc;

import android.widget.SimpleCursorAdapter;
import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.widget.TextView;

public class PlaceAdapter extends SimpleCursorAdapter {
	static final String[] FROM = { PlacesDB.P_NAME };
	static final int[] TO = { R.id.place_button };
	
	public PlaceAdapter(Context context, Cursor c){
		super(context, R.layout.check_row, c, FROM, TO);
	}
	
	@Override
	public void bindView(View row, Context context, Cursor cursor){
		super.bindView(row, context, cursor);
		
		int stamp = cursor.getInt(cursor.getColumnIndex(PlacesDB.P_ID));
		TextView button = (TextView)row.findViewById(R.id.place_button);
		button.setText(cursor.getColumnIndex(PlacesDB.P_NAME));
	}
}
